/**
 * 
 */
package com.study.io.netty;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;
import io.netty.handler.codec.Delimiters;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;

/**
 * @author Administrator
 * @date 2019年6月9日
 */
public class ServerChannelInitizlizer extends ChannelInitializer<SocketChannel> {
	 
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        //communication channel
        ChannelPipeline pipeline = socketChannel.pipeline();
        
        pipeline.addLast(new StringDecoder());
        pipeline.addLast("serverChannelHandler",new ServerChannelHander());
        pipeline.addLast("serverChannelHandler2",new ServerChannelHander2());
        pipeline.addLast(new StringEncoder());
    }
}
